local skel = fk.CreateSkill{
  name = "kpaII__womenlaiguo",
}
local KleeU = require "packages/klee_xy_I/utility/k_utility"
Fk:loadTranslationTable{
  ["kpaII__womenlaiguo"] = "我们来过",
  [":kpaII__womenlaiguo"] = "每轮限一次，当你使用牌时，你可将手牌数摸至体力上限，本轮点数不为本次摸牌数倍数的伤害牌不能被使用。",
  ["#kpaII__womenlaiguo"] = "我们来过：你可将手牌数摸至体力上限",

  ["@kpaII__womenlaiguo-round"] = "来过"
}

skel:addEffect(fk.CardUsing, {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and player:usedSkillTimes(self.name, Player.HistoryRound) == 0
    and (player.maxHp - player:getHandcardNum()) > 0
  end,
  on_cost = function (self, event, target, player, data)
    local yn = KleeU.askYesOrNo(player, "#kpaII__womenlaiguo",skel.name)
    return yn
  end,
  on_use = function(self, event, target, player, data)
    local y = player.maxHp - player:getHandcardNum()
    if y > 0 then
      player:drawCards(y, skel.name)
      for _,p in ipairs(player.room:getAlivePlayers()) do
        player.room:setPlayerMark(p,"@kpaII__womenlaiguo-round",y)
      end
    end
  end,
})

skel:addEffect("prohibit", {
  prohibit_use = function(self, player, card)
    return player:getMark("@kpaII__womenlaiguo-round") > 0 and card.number > 0 and
      (card.number % player:getMark("@kpaII__womenlaiguo-round")) ~= 0 and card.is_damage_card
  end,
})

return skel